using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class WindController : MonoBehaviour
{
    public Vector2 windForce = new Vector2(1f, 0);

    public float windChangeInterval = 5f;

    public float maxWindShift = 2f;
    // Start is called before the first frame update
    void Start()
    {
        StartCoroutine(ChangeWindDirection());
    }

    IEnumerator ChangeWindDirection()
    {
        while (true)
        {
            windForce += new Vector2(
                Random.Range(-maxWindShift, maxWindShift),
                Random.Range(-0.5f, 0.5f));
            yield return new WaitForSeconds(windChangeInterval);
        }
    }
}
